{% extends "special_menu.html" %}
{% load i18n %}

{% block getdatalist %}
    var href = window.location.href;
    if(href.split("/")[3] == "iaccess")
    {
        {% if not request.user|HasPerm:"contenttypes.can_DoorSetPage" %}
            $("#id_datalist").remove();
            $("#id_search").remove();      
            alert(gettext("对不起，您没有访问该页面的权限，不能浏览更多信息！"));
            window.location.href = "/{{ request.surl }}accounts/login/";
        {% endif %}<!-- contenttypes.can_DoorSetPage --> 
    }
    else if(href.split("/")[3] == "elevator")//if中无法传入变量？
    {
        {% if not request.user|HasPerm:"contenttypes.can_FloorMngPage" %}
            $("#id_datalist").remove();
            $("#id_search").remove();   
            alert(gettext("对不起，您没有访问该页面的权限，不能浏览更多信息！"));
            window.location.href = "/{{ request.surl }}accounts/login/";
        {% endif %}<!-- contenttypes.can_FloorMngPage --> 
    }
    if("{{ position }}" == "")
    {
        window.location.href = $("#id_special_menu ul:first li a").attr("href");//跟模型相关的页面在此重定向
    }
    {% block acc_door_set %}{% endblock %}
    {% if request.user|HasPermDefaultGiven:"iaccess.browse_accdoor" %}
    $("#monitor_AccDoor").remove()
    {% endif %}
{% endblock %}
